import request from '@/utils/request'

const api_name = '/admin/hosp/hospitalSet'

export default {

  /**
   * ApiOperation("U-更新医院设置表的status字段")
   * @param id
   * @param status
   * @returns {AxiosPromise}
   */
  lockHospSet(id, status) {
    return request({
      url: `${api_name}/lockHospitalSet/${id}/${status}`,
      method: 'put'
    })
  },
  // @ApiOperation("7 删除医院设置-批量删除")
  batchRemoveHospitalSet(idList) {
    return request({
      url: `${api_name}/batchRemove`,
      method: 'delete',
      data: idList
    })
  },

  /**
   * ApiOperation("R-根据ID查询医院设置")
   * @param id
   * @returns {AxiosPromise}
   */
  getHospSetById(id) {
    return request({
      url: `${api_name}/getHospSet/${id}`,
      method: 'get'
    })
  },

  /**
   * ApiOperation("U-根据ID修改医院设置")
   * @param hospitalSet
   * @returns {AxiosPromise}
   */
  updateHospSet(hospitalSet) {
    return request({
      url: `${api_name}/updateHospSet`,
      method: 'post',
      data: hospitalSet
    })
  },

  /**
   * ApiOperation("C-医院设置信息")
   * @param saveObj
   * @returns {AxiosPromise}
   */
  saveHospSet(saveObj) {
    return request({
      url: `${api_name}/saveHospitalSet`,
      method: 'post',
      data: saveObj
    })
  },

  /**
   * ApiOperation("D-根据id删除医院设置信息")
   * @param id
   * @returns {AxiosPromise}
   */
  removeById(id) {
    return request({
      url: `${api_name}/remove/${id}`,
      method: 'delete'
    })
  },

  /**
   * ApiOperation("R-医院设置列表,条件查询(hosname,hoscode),分页")
   * @param currentPage
   * @param limit
   * @param searchObj
   * @returns {AxiosPromise}
   */
  getPageList(currentPage, limit, searchObj) {
    return request({
      url: `${api_name}/findPageQuery/${currentPage}/${limit}`,
      method: 'post',
      // JSON格式数据,使用data:参数
      // 非JSON格式数据,使用params:参数
      data: searchObj
    })
  }
}
